<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>单表管理</title>
	<meta name="decorator" content="default"/>
	<style type="text/css">
		td.imageTd {
			text-align: center;
		}
	</style>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/ht/htHouse/?type=${type}">房源列表</a></li>
		<shiro:hasPermission name="ht:htHouse:edit"><li><a href="${ctx}/ht/htHouse/form?type=${type}">房源添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="htHouse" action="${ctx}/ht/htHouse/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<input id="ListType" name="type" type="hidden" value="${type}"/>
		<ul class="ul-form">
			<li><label>名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>编号：</label>
				<form:input path="code" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>地址：</label>
				<form:input path="address" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>规格：</label>
				<form:select path="standard" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('ht_house_standard')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>面积：</label>
				<form:input path="houseArea" htmlEscape="false" maxlength="11" class="input-medium"/>
			</li>
			<li><label>总价格：</label>
				<form:input path="price" htmlEscape="false" class="input-medium"/>
			</li>
			<li><label>楼层：</label>
				<form:input path="storey" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>单价：</label>
				<form:input path="unitPrice" htmlEscape="false" class="input-medium"/>
			</li>
			<li><label>业主：</label>
				<form:input path="owner" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>业主电话：</label>
				<form:input path="ownerPhone" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>方向：</label>
				<form:select path="orientation" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('ht_house_orientation')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>图片地址</th>
				<th>名称</th>
				<th>编号</th>
				<th>地址</th>
				<th>规格</th>
				<th>类型</th>
				<th>面积</th>
				<th>总价格</th>
				<th>楼层</th>
				<th>单价</th>
				<th>业主</th>
				<th>业主电话</th>
				<th>方向</th>
				<th>状态</th>
				<th>备注</th>
				<shiro:hasPermission name="ht:htHouse:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="htHouse">
			<tr>
				<td class="imageTd">
					<img style="height: 100px;width: 100px;" src="${htHouse.image}"/>
				</td>
				<td><a href="${ctx}/ht/htHouse/form?id=${htHouse.id}">
					${htHouse.name}
				</a></td>
				<td>
					${htHouse.code}
				</td>
				<td>
					${htHouse.address}
				</td>
				<td>
					${fns:getDictLabel(htHouse.standard, 'ht_house_standard', '')}
				</td>
				<td>
					${fns:getDictLabel(htHouse.houseType, 'ht_house_type', '')}
				</td>
				<td>
					${htHouse.houseArea}
				</td>
				<td>
					${htHouse.price}
				</td>
				<td>
					${htHouse.storey}
				</td>
				<td>
					${htHouse.unitPrice}
				</td>
				<td>
					${htHouse.owner}
				</td>
				<td>
					${htHouse.ownerPhone}
				</td>
				<td>
					${fns:getDictLabel(htHouse.orientation, 'ht_house_orientation', '')}
				</td>
				<td>
				    ${fns:getDictLabel(htHouse.status, 'ht_house_status', '')}
				</td>
				<td>
					${htHouse.remarks}
				</td>
				<shiro:hasPermission name="ht:htHouse:edit"><td>
    				<a href="${ctx}/ht/htHouse/form?id=${htHouse.id}&type=${htHouse.houseType}">修改</a>
					<a href="${ctx}/ht/htHouse/delete?id=${htHouse.id}" onclick="return confirmx('确认要删除该单表吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>